package com.example.common.core.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

@AllArgsConstructor
@Getter
@ToString
public enum ResultCode {
    //操作唱功
    SUCCESS(1000, "操作成功"),
    //服务器内部错误，友好提⽰
    ERROR(2000, "服务繁忙请稍后重试"),
    //操作失败，但是服务器不存在异常
    FAILED(3000, "操作失败"),
    FAILED_UNAUTHORIZED(3001, "未授权"),
    FAILED_PARAMS_VALIDATE(3002, "参数校验失败"),
    FAILED_NOT_EXISTS(3003, "资源不存在"),
    FAILED_ALREADY_EXISTS(3004, "资源已存在"),
    AILED_USER_EXISTS(3101, "用户已存在"),
    FAILED_USER_NOT_EXISTS(3102, "用户不存在"),
    FAILED_LOGIN(3103, "用户名或密码错误"),
    FAILED_USER_BANNED(3104, "您已被列⼊⿊名单, 请联系管理员."),
    ILLEGAL_EMAIl(3104, "非法格式的邮件"),
    FREQUENT_GET_CODE(3105, "获取验证码频繁，请稍后重试"),
    FAILED_GET_CODE_LIMIT(3106, "当日获取验证码次数频繁"),
    VALID_CODE(3016, "无效验证码"),
    ERROR_CODE(3107, "验证码错误"),
    /*
     *1xxxx
     */
    SUCCES_ADD_QUESTION(1001, "新增题目成功"),
    FAILED_ADD_QUESTION(1002, "新增题目失败"),
    FAILED_GET_QUESTION(1003, "获取题目详情失败"),
    FAILED_ADD_QUESTION_FOR_REPEATED_TITLE(1004, "新增题目失败，重复的题目标题"),
    FAILED_EDIT_QUESTION(1004, "编辑题目失败，请稍后重试"),
    SUCCESS_EDIT_QUESTION(1005, "编辑题目成功"),
    ILLEGAL_QUESTIONED_ID(1006, "不合法的题目ID"),
    QUESTION_NOT_EXIST(1007, "题目不存在"),
    SUCCESS_DELETE_QUESTION(1008, "删除题目成功"),
    FAILED_DELETE_QUESTION(1009, "删除题目失败"),


    /*
     *竞赛相关,2xxx
     */
    FAILED_TO_ADD_EXAM(2001, "新增竞赛失败"),
    SUCCESS_TO_ADD_EXAM(2002, "新增竞赛成功"),
    REPETITIVE_EXAM(2003, "重复的竞赛题目"),
    SN_TIME_ERROR(2004, "竞赛开始时间不能晚于结束时间"),
    VALID_EXAM_ID(2005, "竞赛ID非法"),
    NON_EXAM(2006, "竞赛不存在"),
    STARTED_EXAM(2007, "竞赛已经开始，不可重复报名"),
    USER_HAS_EXAM(2008, "用户已经报名改竞赛，不可重复报名"),
    FAILED_FIRST_QUESTION(5001, "....."),
    FAILED_LAST_QUESTION(5002, "....."),
    /*
     *竞赛相关,3xxx
     */
    NON_SUPPORT_LANGUAGE(3001,"当前编程语言暂不支持");
    /**
     * 状态码
     */
    private final int code;
    /**
     * 状态描述
     */
    private final String msg;
}
